{include file="header.tpl"}
{literal}
<script language="javascript">
function operations(operation)
{
	total_ids1=document.form1.total_ids.value;
	
	total_ids1=total_ids1.split(",");
	var objname,cnt=0;
	for(i=0;i<=total_ids1.length-2;i++)
	{
		objname=eval("document.form1.C1_" + total_ids1[i] + ".checked");
		if(objname==true)	
		{
			cnt=1;
		}
	}
	if(cnt==1)
	{
	  	if(operation=='delete' && window.confirm("Warning: Are you sure?\nDeletion is permanent. Continue anyway."))
	   	{
	   		document.form1.action="bhatthiPartyDelete.php?mode=delete&wp=1"
				document.form1.submit();
			return;
	   	}
	}
	else
	{
		alert("Please Check at least one check box");
	}
}      
function conf(bhatthipartyId)
{
	if(confirm("Are You Sure You want to Delete Record?"))
			location.href="bhatthiPartyDelete.php?bhatthipartyId="+bhatthipartyId;
	else
  		location.href="bhatthiPartyList.php";
}
//single checkbox operation
function operations_private(operation,id)
{
	total_ids1=document.form1.total_ids1.value;
	total_ids1=total_ids1.split(",");
	var objname;
	for(i=0;i<=total_ids1.length-2;i++)
	{
		if(total_ids1[i] == id)
		{
		objname="document.form1.C1_" + total_ids1[i] + ".checked=true";
		}
		else
		{
		objname="document.form1.C1_" + total_ids1[i] + ".checked=false";
		}
		if(objname != "document.form1.C1_0.checked=false")
		{
		eval(objname); //is used to execute dynamic javascript code
		}
	}

	//calling the submit pocedure
	operations(operation);
}
function checkall()
{
	total_ids=document.form1.total_ids.value;
	total_ids=total_ids.split(",");
	var objname;
	for(i=0;i<=total_ids.length-2;i++)
	{
		objname="document.form1.C1_"+ total_ids[i] + ".checked=true";
		
		if(objname != "document.form1.C1_0.checked=true")
		{
			eval(objname); //is used to execute dynamic javascript code
		}
	}
}

//function to uncheck all checkboxes
function checknone()
{
	total_ids=document.form1.total_ids.value;
	total_ids=total_ids.split(",");
	var objname;
	for(i=0;i<=total_ids.length-2;i++)
	{
		objname="document.form1.C1_" + total_ids[i] + ".checked=false";
		if(objname != "document.form1.C1_0.checked=false")
		{
			eval(objname); //is used to execute dynamic javascript code
		}
	}
}
</script>
{/literal}      
<form name="form1">
<table border="1" align="center" cellpadding="1" cellspacing="1">
{if $i eq 0}
  {$msg}
{else}
<center class="center"><B>{$l_listBhatthiParty}<b></center><br>
	<tr>
		<td class="table1"></td>
	  <td align="center" class="table1">{$l_bhatthipartyName}</td>
	</tr>
  {section name="sec" loop=$i}
  	<tr  onmouseover="this.className='linkover'" onmouseout="this.className='linkout'">
  	  <td class="table2" align="center">
  	    <a href="bhatthiPartyEdit.php?bhatthipartyId={$bhatthipartyId[sec]}" class="link">{$l_edit}</a>
  	  </td>
      
    	<td class="table2" align="center">{$bhatthipartyName[sec]}</td>
    </tr>
  {/section}
		
		
{/if}
</table>
</form>
{include file="footer.tpl"}
